package Month11.Day10;

public class T1{
    public static void main(String[] args) {
        String a="dog";
        String b="This is a good dog dog";
        int count=0;
        String[] s = b.split(" ");
        for (int i=0;i<s.length;i++){
            System.out.println(s[i]);
            if (a.equals(s[i])){
                count++;
            }
        }
        System.out.println("有"+count+"次重复！");

    }
}
